package cn.assumejson.springframework.aop.aspectj;

import cn.assumejson.springframework.aop.ClassFilter;
import cn.assumejson.springframework.aop.MethodMatcher;
import cn.assumejson.springframework.aop.Pointcut;

/**
 * @author gang.Li
 * @version 1.0
 * @since 1.0 2021/12/9 20:46
 */
public class TruePointcut implements Pointcut {

    public static final TruePointcut INSTANCE = new TruePointcut();

    /**
     * Enforce Singleton pattern.
     */
    private TruePointcut() {
    }


    @Override
    public ClassFilter getClassFilter() {
        return TrueClassFilter.TRUE;
    }

    @Override
    public MethodMatcher getMethodMatcher() {
        return TrueMethodMatcher.TRUE;
    }

    /**
     * 繁殖 单例非强制破解
     *
     * @return
     */
    private Object readResolve() {
        return INSTANCE;
    }

    @Override
    public String toString() {
        return "Pointcut.TRUE";
    }


}
